import Cookies from "js-cookie";

const tokenKey = "carsAccountToken";
const usernameKey = "carsAccountUsername";

export function setToken(value) { 
  Cookies.set(tokenKey,value); // 文档可以看官网，它里面还可以配置有效期啥的
}

export function getToken() { 
  return Cookies.get(tokenKey); 
}

export function getTokenCars() { 
  return Cookies.get(tokenKey); 
}

export function removeToken() {
  return Cookies.remove(tokenKey);
}

export function setUsername(value) { 
  Cookies.set(usernameKey,value); 
}

export function getUsername() { 
  return Cookies.get(usernameKey); 
}

export function removeUsername() {
  return Cookies.remove(usernameKey);
}
